package lifeOfAFish.scenegraph.geom;

import lifeOfAFish.scenegraph.*;

public class sgGeomSphere extends sgGeometry {

	private float m_radius;
	
	public sgGeomSphere()
	{
		m_radius = 1.0f;
	}
	
	public sgGeomSphere(float rad)
	{
		m_radius = rad;
	}
	/**
	 * inherited draw function
	 */
	protected void draw() {
		sgGlobals.glut.glutSolidSphere(m_radius, 10, 10);
	}
	
	/**
	 * Return (local) bounding box
	 */
	public float[] getBoundingBox(){
		float[] bb = new float[6];
		float edge = m_radius;
		for(int i = 0; i < 6; i++)
		{
			bb[i] = -edge;
			edge *= -1;
		}
		return bb;
	}
}
